package com.mybatis;

import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface IGenericDao<T, PK> {
    @Delete({"Batch.MapperGD.delete.ids"})
    void BatchDeleteEntity(List<PK> list);

    @Select({"Batch.MapperGD.find.byIds"})
    List<T> BatchFindEntity(List<PK> list);

    @Insert({"MapperGD.insert.entity"})
    void addSingleEntity(T t);

    @Insert({"Batch.MapperGD.insert.entity"})
    void batchAddEntity(List<T> list);

    @Delete({"MapperGD.delete.id"})
    void deleteSingleEntityById(PK pk);

    @Delete({"MapperGD.delete.condition"})
    void deleteSomeEntity(Map<String, Object> map);

    @Select({"MapperGD.find.entityById"})
    T findSingleEntity(PK pk);

    @Select({"MapperGD.find.entity"})
    List<T> findSomeEntity(T t);

    @Select({"MapperGD.find.entitys"})
    List<T> findSomeEntityByMap(Map<String, Object> map);

    @Update({"MapperGD.update.entity"})
    void updateSingleEntity(T t);

    @Update({"MapperGD.update.entity"})
    void updateSingleEntityById(Map<String, Object> map);
    
    @Update({"Batch.MapperGD.update.entity"})
    void batchUpdateEntity(List<T> list);
}
